//
// Created by v on 24-6-4.
//

#include "base_image_operation.h"

#include "opencv2/opencv.hpp"

BaseImageOperation::BaseImageOperation() {}

BaseImageOperation::~BaseImageOperation() {}

int BaseImageOperation::two_value_image(char *input, char *output) {

    return 0;
}

int BaseImageOperation::rotateIt(char *input, char *output)
{
    cv::Mat in = cv::imread(input, cv::IMREAD_COLOR);
    cv::Mat out;
    cv::rotate(in, out, cv::ROTATE_180);
    cv::imwrite(output, out);
    return 0;
}

int BaseImageOperation::resizeIt(char *input, char *output) {

    cv::Mat in = cv::imread(input, cv::IMREAD_COLOR);
    cv::Mat out;
    cv::resize(in, out, cv::Size {640, 640});
    cv::imwritemulti(output, out);
    return 0;
}
